<?php
if(isset($_GET['act'])){
	switch($_GET['act']){
		case "gallery": 
			$meta_title = 'Gallery :: '.DOMAIN;
			$display = 'gallery.tpl.php';
			break;
		
		case "pvp-ladder": 
			$meta_title = 'PVP Ladder :: '.DOMAIN;
			$display = 'pvp.ladder.tpl.php';
			break;
		case "how-to-donate": 
			$meta_title = 'Donate :: '.DOMAIN;
			$display = 'donate.tpl.php';
			break;
		case "installation": 
			$meta_title = 'Installation :: '.DOMAIN;
			$display = 'installation.tpl.php';
			break;
		case "downloads": 
			$meta_title = 'Downloads :: '.DOMAIN;
			$display = 'downloads.tpl.php';
			break;
		case "contact-us": 
			$meta_title = 'Contact Us :: '.DOMAIN;
			$display = 'contact.us.tpl.php';
			break;
		case "server-information":
			$meta_title = 'Server Information :: '.DOMAIN;
			$display = 'server.information.tpl.php';
			break;
		case "read":
			$result = mysql_query("SELECT posts.*,login.username FROM posts,login WHERE login.loginid = posts.post_user AND id = ".mysql_real_escape_string($_GET['id'])."");
			$row = mysql_fetch_assoc($result);
			$post_title = $row['title'];
			$post_date = $row['date'];
			$post_body = nl2br($row['body']);
			$post_username = $row['username'];
			$post_canonical_url = 'http://www.jeth-ro.com'.parse_url($_SERVER['REQUEST_URI'],PHP_URL_PATH);
			
			$meta_title = $post_title.' :: '.DOMAIN;
			
			$meta_og = '<meta property="og:image" content="http://www.jeth-ro.com/templates/default/images/fb.logo.png">
			<meta property="og:url" content="http://www.jeth-ro.com'.$_SERVER['REQUEST_URI'].'">
			<meta property="og:title" content="'.$meta_title.'">
			';
			
			$display = 'read.tpl.php';
			break;
		default: $display = 'main.tpl.php'; break;
	}
}
else $display = 'main.tpl.php';

$getStories = mysql_query("SELECT `posts`.*,login.username FROM `posts`,login WHERE `category` = 4 AND login.loginid = posts.post_user ORDER BY `date` DESC");

?>